/**
 * Created by Administrator on 2017/7/19.
 */
let util = require('../util/util.js');
let weixinSDK = require('../util/weixinSDK.js'); 

let pay = module.exports;

pay.callback = function (req, res) {
    res.header('Access-Control-Allow-Origin', '*');
    console.log(res);
    let data = util.getRequestParam(req);
    console.log('pay.callback',data);
    let result = weixinSDK.payCallback(data); 
    if (result) {
        console.log("充值 OK");
    }
    var xml = '<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>'
    res.send(xml).end();
};